<!DOCTYPE html>
<html>
  <head>
    <title>我要报名</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	  <link rel="stylesheet" href="${s.base}/mobile/css/base.css">
	  <link rel="stylesheet" href="${s.base}/mobile/css/component.css">
	  <link rel="stylesheet" href="${s.base}/mobile/css/weui.min.css">
	  <link rel="stylesheet" href="${s.base}/mobile/css/jquery-weui.css">
	  <style type="text/css">
		  .xyg-navigation{width:100%; height:auto;padding: 0.5rem; background: #fff;}
		  .xyg-navigation .xyg-navigation-item{width:auto; padding: 0px 0.4rem; letter-spacing: 0.1rem; color: #000000; font-size: 15px; font-weight: bold;height:1rem; line-height: 1rem;float: left;}
		  .xyg-navigation .xyg-navigation-line{width:0.1rem; margin:0.25rem 0.1rem; background:#0D0D0D;height:0.5rem;float: left;}
		  .xyg-content{width:100%; height:auto; }
		  .xyg-content .xyg-content-item{width:94%; height:auto; background:#FFF; margin:0.5rem 2%;border-radius:0.2rem; padding:0.5rem 1%;}
		  .xyg-content .xyg-content-item .xyg-content-item-left{width:42%; padding-left: 2%; height:auto; float: left;}
		  .xyg-content .xyg-content-item .xyg-content-item-left img{width:100%;height:6rem;border-radius:0.2rem}
		  .xyg-content .xyg-content-item .xyg-content-item-right{width:54%; padding: 0px 1%; height:auto; float: right;}
		  .xyg-content .xyg-content-item .xyg-content-item-right>div{width:99%;line-height: 1rem; margin-left: 1%;}
		  .xyg-content .xyg-content-item .xyg-content-item-right .xyg-content-item-right-title{min-height: 3rem;}
		  .xyg-content .xyg-content-item .xyg-content-item-right .xyg-content-item-right-time{height: 2rem;}
		  .xyg-content .xyg-content-item .xyg-content-item-right .xyg-content-item-right-num{height:1rem;}
		  .lwhbg a {padding:5px;background-color:#cc0000;display:block;color:#fff;}
	  </style>
  </head>
  <body>
  <div class="xyg-index">
   <div class="xyg-navigation" style="position: fixed; left: 0px; top: 0px;">
	   <#list sysDictContentList as sysDictContent>
		  <!-- <#if sysDictContent_index gt 0>
			   <div class="xyg-navigation-line"></div>
		   </#if>
           <#if sysDictContent.value=='1'>
               <div class="xyg-navigation-item" onclick="initData('${sysDictContent.value}')">${sysDictContent.name}</div>
           </#if>  -->
	   </#list>
	   <div class="xyg-navigation-item" onclick="window.location.href='/weiXin/oauth?path=/phone/signUpGyList&pathParams=type*2'">公益班报名</div>
       <div class="xyg-navigation-item lwhbg" onclick="window.location.href='/phone/corporationAdd?memberId=${memberId}'">社团报名</div>
       <div class="clearBoth"></div>
   </div>
	  <div style="width: 100%; height: 2rem;"></div>
   <!--内容开始-->
  <div class="xyg-content">
  </div>
  <!--内容结束-->
  </div>  
  </body>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
  <script src="${s.base}/mobile/js/jquery-2.1.4.js"></script>
  <script src="${s.base}/mobile/js/jquery-weui.js"></script>
  <script src="${s.base}/mobile/js/dateUtil.js"></script>
  <script src="${s.base}/mobile/fonts/iconfont.js"></script>
  <script>
      var memberId='${memberId}';
      var type='${type}';
      var loading = false;  //状态标记
      var isDestroyInfinite = type;//是否销毁
      var pageSize=5;//页面大小
      var pageNum=0;//当前页面
      $(document).ready(function(e) {
          initData(type);
      });
      function sendPost() {
          pageNum++;
          $.post("/phone/signUpPage",{
              pageNum : pageNum,
              pageSize : pageSize,
              type : type
          },function(resultInfo){
              if (resultInfo.code == 0){
                  if (resultInfo.data!=null && resultInfo.data.length > 0){
                      for(var i=0;i<resultInfo.data.length;i++){
                          var obj = resultInfo.data[i];
                          var content=
							  '<div class="xyg-content-item"><a href="/phone/signUpDesc?id='+obj.id+'&memberId='+memberId+'">'+
								  '<div class="xyg-content-item-left">'+
								  	'<img src="'+ obj.picture+'"/>'+
								  '</div>'+
								  '<div class="xyg-content-item-right">'+
									  '<div class="xyg-content-item-right-title font1">'+obj.title+
									  '</div>'+
									  '<div class="xyg-content-item-right-time font4">'+
										 '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-shijian"></use></svg>&nbsp;'+$.fn.formatDate(new Date(obj.startDate), "yyyy/MM/dd")+'-'+$.fn.formatDate(new Date(obj.endDate), "yyyy/MM/dd")+
									  '</div>'+
									  '<div class="xyg-content-item-right-num font4">'+
									  '已报名：'+obj.memberNum+'人'+
									  '</div>'+
								  '</div>'+
								  '<div class="clearBoth"></div>'+
						  '</a></div>';
                          $(".xyg-content").append(content);
                          loading = false;
                          if(!resultInfo.hasNextPage){
                              isDestroyInfinite=true;
                              $(document.body).destroyInfinite();
                          }
                      }
                  }
              }
          },"json");
      }

      function initData(typeValue) {
          //设置type值
		  type=typeValue;
		  //清空内容
          $(".xyg-content").html("");
          //设置分页起始页数
          pageNum=0;
		  //如果是销毁，初始化下拉刷新
		  if(isDestroyInfinite){
              $(document.body).infinite();
              $(document.body).infinite().on("infinite", function() {
                  if(loading) return;
                  loading = true;
                  sendPost();
              });
		  }
		  //首次调用内容
          sendPost();
      }

  </script>
</html>

